<?php


namespace App\Http\Controllers\Index;



use App\Models\Book;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Redis;
use function App\Helpers\{getLastEndWeekDate,getLastStartWeekDate,successMsg};

class IndexController extends Controller
{
    public function __destruct()
    {
       //DB::table("chapter_2021")->insert(['uni_code' => date("Y-m-d H:i:s",time())]);
    }
    public function index()
    {
        echo getLastEndWeekDate();
        echo getLastStartWeekDate();
        return successMsg();
        //return $start_time.'---------'.$end_time;
    }
    public function testRedis()
    {
        $arr = [
            'name' => 'xiaoming',
            'age' => 16,
            'address' => 'he nan'
        ];
        Cache::put("woaini",json_encode($arr));
       $val = Cache::get("woaini");
       var_dump($val);
    }
    public function indexs()
    {
        $bookObj = (new Book(date("Y")));
        $res = $bookObj->getTest();
        var_dump($res);
    }
    public function getArr()
    {
        return [
            "appid"=>"JLX",
            "mobile"=>"13826597962",
            "name"=>"赵娜",
            "city"=>"深圳",
            "sex"=>"2",
            "daiMoney"=>"",
            "haveCredit"=>"1",
            "hourseDai"=>"3",
            "carDai"=>"2",
            "occapation"=>"",
            "payType"=>"1",
            "income"=>"4",
            "reservedFunds"=>"5",
            "socialSecurity"=>"1",
            "daiTime"=>"",
            "sign"=>"fgjsgsjgjsafgjsgfa"
        ];
    }
    //测试一个类什么时候销毁
    public function testClassDel()
    {

    }

}
